
n = 95041567
factor = [31, 37, 41, 43, 47]

for i in factor:
    print n / i


for i in range(0, 5):
    M = n / factor[i]
    for j in range(0, factor[i]):
        if M * j % factor[i] == 1:
            print j
            break

